home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: Checking For Keyboard
- Date: 01 Mar 1996 15:20:42 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar1082042@qcd.lanl.gov>
- References: <4h2ojc$krq@gail.ripco.com> <1181@altheim.win-uk.net>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: broldham@altheim.win-uk.net's message of Thu, 29 Feb 1996 20:18:06 GMT
-
- In article <1181@altheim.win-uk.net>
- broldham@altheim.win-uk.net (Brian R. Oldham) writes:
-
- <snip>
- BRO: I will read this FAQ, when I can find it. It must be some important
-
- Most FAQs are available by anonymous ftp from rtfm.mit.edu. Most books
- on the internet should provide this information. More importantly,
- service providers ought to make sure their users have it. In any case,
- now you know it.
-
- And, long standing internet ettiquette demands that you read the FAQ
- _before_ posting; not after as you plan to do.
-
- BRO: document judging by the awe and reverence in which you guys seem to
-
- Such arrogance backed up by capability is certainly awesome.
- Unfortunately, the combination is truly rare. Very few people
- who have used C know all aspects of what the language spec says. The
- FAQ is likely to surprise you if you haven't seen it before.
-
- BRO: hold it. Etched in granite is it? As I say, I will read it, but I
-
- Not etched in granite: mistakes are occasionally found in it. However,
- these being frequently asked questions, are also frequently answered
- questions. Just because of the large number of knowledgeable people
- frequenting this group, it is unlikely that a mistake would survive
- for long.
-
- BRO: don't expect it to contradict anything I have already learned about C,
- BRO: or in FAQs from other newsgroups. If it does I may have questions.
-
- Sure. The FAQ is supposed to be clear, if you do not understand
- something, please point it out.
-
- BRO:
- BRO: >>.... A simple
- BRO: >>brief mention of kbhit() or equivalent, or a call to whatever interrupt
- BRO: >>pauses the keyboard would have been helpful,...
- BRO: >
- BRO: >In other words, a simple mention of every possible non-C answer should
- BRO: >have been the answer in comp.lang.c. Get real.
- BRO: >
- BRO:
- BRO: I'm sure you know that there are jobs you can do in C that cannot be
- BRO: done in some other languages e.g., cobol, so if someone asks how to do
- BRO: something specific, like check keyboard for byte waiting, then he is
-
- No I do not. If you think you do, please go an read the document that
- starts by saying:
-
- This International Standard specifies the form and establishes the
- interpretation of programs written in the C programming language.
-
- and guess what? Nowhere in the entire 176 page document is there a
- mention of how to check the keyboard for a byte waiting. In fact, I
- know of systems running C which did not have any way of testing the
- keyboard which was not even under the direct control of the CPU.
-
- The error you are making is a very common one. Operating systems often
- provide routines to do operation system specific tasks. These
- routines, in almost any operating system worth its name can be called
- from almost any language that the system supports natively. These
- routines form a part of the operating system and not any specific
- language.
-
- BRO: entitled to expect the information he seeks and not to be told his
- BRO: question is off-topic. As far as the newbie is concerned, if a job can be
- BRO: done using C then the question is relevant to c.l.c. With your experience
-
- Can I ask the good people of alt.usage.english to explain to me the
- theory of relativity simply because it can be explained in English?
-
- The problem is that as far as C is concerned, the answer is that it
- cannot be done. Under _certain_ operating systems, you can ask the OS
- to check; but how you do it is completely different from compiler to
- compiler and OS to OS. Does the kbhit() solution have any relevance to
- the machine I am using to type in this post right now?
-
- BRO: you know the distinction and, believe it or not so do I, but I totally
- BRO: disagree with your self imposed rule that newcomers to C may not ask such
- BRO: questions. If there is anything in your FAQ to support such a rule then
- BRO: I suspect in some cases over-zealous interpretation.
-
- The only rule people are asking to be imposed is that everyone read
- the FAQ before posting: else they be referred to the FAQ. I do the
- same to you: why do you not humour us, and go read it?
-
- <snip>
- BRO: >The right answer to a newbie who asks a question inappropriate to the
- BRO: >newsgroup is to ignore it or to let him know that this is not the place
- BRO: >to ask. Such a question shows a complete disregard for USENET/NEWSNET
- BRO: >practices and is the rude component of the exchange.
- BRO: >
- BRO:
- BRO: Rubbish! If you want to talk about Usenet practices then just compare
- BRO: this group (c.l.c) with others. I haven't been in this group very long
- BRO: - just a few days - but already I have seen a difference; c.l.c is more
- BRO: like a classroom with dialog between teachers and pupils than a debating
- BRO: forum where all members have equality. It seems to me that it is you
- BRO: guys who have forgotten the 'raison d'etre' for Usenet.
-
- It is difficult to have a dialog with people who are plain wrong. If
- more people would just learn to read the FAQ before posting obvious
- garbage (arrays _are_ pointers, i = i++, etc.), people could have
- meaningful discussions about better and worse ways of doing things,
- about portable ways of doing things, about real compiler problems they
- have and whether they have a right to expect a certain behaviour from
- their programs etc.
-
- Of course, then the group would be similar to a normal language group
- with probably 10-15 postings per day, rather that 100-200 as currently
- found.
-
- <snip>
- BRO: Jeez! How picky can you get? Asking how to check the keyboard buffer
- BRO: (using C even) is not like he had asked how to grow potatoes.
-
- Given the right machine and OS, they can be done equally easily in C.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-